﻿Imports VSModel
Partial Class Control_DangKy_TraCuu
    Inherits System.Web.UI.UserControl

    Protected Sub btnSave_Click(sender As Object, e As System.EventArgs) Handles btnSave.Click
        Using _data As New VSEntities

            Dim p = (From q In _data.DangKies Where q.SoBienNhan = txtBienNhan.Text.Trim Select q).FirstOrDefault
            If Not p Is Nothing Then
                If Not p.KetQuaPhanTich Is Nothing Then
                    DivKetQua.Visible = True
                    ltrKetqua.Text = p.KetQuaPhanTich
                Else
                    DivKetQua.Visible = True
                    ltrKetqua.Text = "Chưa có kết quả phân tích"
                End If
            Else
                DivKetQua.Visible = False
            End If

        End Using
    End Sub

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            DivKetQua.Visible = False
        End If
    End Sub

    Protected Sub btnReset_Click(sender As Object, e As System.EventArgs) Handles btnReset.Click
        txtBienNhan.Text = ""
        DivKetQua.Visible = False
    End Sub
End Class
